Copy Tables

require.mx('mxjs/base/algorithims/copy_tables.js');

This is the copy tables library.

StatusName
copy_all ( Object ↓outTable, Object ↓inTable, Number ↓beginIdx, Number ↓endIdx )

Copies all rows from inTable to outTable. Expects the outTable to have all columns from inTable with the same name.

copy_all_with_add ( Object ↓outTable, Object ↓inTable, Object ↓newValues )

Copies all rows from inTable to outTable starting and adds a row for newValues. Expects the outTable to have all columns from inTable with the same name.

copy_all_with_delete ( Object ↓outTable, Object ↓inTable, function ↓condition )

Copies all rows from inTable to outTable starting from offset in outTable and deletes all rows that satisfy the input condition. Expects the outTable to have all columns from inTable with the same name.

copy_all_with_update ( Object ↓outTable, Object ↓inTable, Object ↓newValues, function ↓condition, boolean ↓writeNulls )

Copies all rows from inTable to outTable starting from offset in outTable and updates all rows that satisfy the input condition with newValues. Expects the outTable and newValues to have all columns from inTable with the same name.


Library Functions

Lib.copy_all ( ↓outTable, ↓inTable, ↓beginIdx, ↓endIdx )

Copies all rows from inTable to outTable. Expects the outTable to have all columns from inTable with the same name.

Parameters:
Lib.copy_all_with_add ( ↓outTable, ↓inTable, ↓newValues )

Copies all rows from inTable to outTable starting and adds a row for newValues. Expects the outTable to have all columns from inTable with the same name.

Parameters:
Lib.copy_all_with_delete ( ↓outTable, ↓inTable, ↓condition )

Copies all rows from inTable to outTable starting from offset in outTable and deletes all rows that satisfy the input condition. Expects the outTable to have all columns from inTable with the same name.

Parameters:
  • Object ↓outTable
  • Object ↓inTable
  • function ↓condition - - function (idx) {return boolean}
Lib.copy_all_with_update ( ↓outTable, ↓inTable, ↓newValues, ↓condition, ↓writeNulls )

Copies all rows from inTable to outTable starting from offset in outTable and updates all rows that satisfy the input condition with newValues. Expects the outTable and newValues to have all columns from inTable with the same name.

Parameters:
  • Object ↓outTable
  • Object ↓inTable
  • Object ↓newValues
  • function ↓condition - - function (idx) {return boolean}
  • boolean ↓writeNulls - - pass true if you want to write null values, otherwise this value will be used to indicate a null. default - 'THISVALUEWILLBENULL'